<%#
# Copyright 2009 Michal Trzcinka
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# 
# http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
# 
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
  "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <title><%= t 'title'  %> </title>

    <!-- Combo-handled YUI CSS files: -->
    <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?2.8.0r4/build/reset-fonts-grids/reset-fonts-grids.css&2.8.0r4/build/assets/skins/sam/skin.css">
    <%= stylesheet_link_tag 'style' %>

    <script type="text/javascript" src="/javascripts/locales.js"></script>

    <!-- Combo-handled YUI JS files: -->
    <script type="text/javascript" src="http://yui.yahooapis.com/combo?2.8.0r4/build/yahoo/yahoo.js&2.8.0r4/build/event/event.js&2.8.0r4/build/connection/connection.js&2.8.0r4/build/dom/dom.js&2.8.0r4/build/dragdrop/dragdrop.js&2.8.0r4/build/animation/animation.js&2.8.0r4/build/container/container.js&2.8.0r4/build/event-mouseenter/event-mouseenter.js&2.8.0r4/build/selector/selector.js&2.8.0r4/build/event-delegate/event-delegate.js&2.8.0r4/build/element/element.js&2.8.0r4/build/menu/menu.js&2.8.0r4/build/button/button.js&2.8.0r4/build/slider/slider.js&2.8.0r4/build/colorpicker/colorpicker.js&2.8.0r4/build/editor/editor.js&2.8.0r4/build/get/get.js&2.8.0r4/build/json/json.js&2.8.0r4/build/logger/logger.js"></script>
    
    <%= javascript_include_tag 'prototype' %>
    <%= javascript_include_tag 'application' %>
    <%= javascript_include_tag 'vcard/utils' %>
    <%= javascript_include_tag 'vcard/prototypes' %>
    <%= javascript_include_tag 'vcard/constants' %>
    <%= javascript_include_tag 'vcard/config' %>
    <%= javascript_include_tag 'vcard/model' %>

    <%= javascript_include_tag 'vcard/view/cells' %>
    <%= javascript_include_tag 'vcard/view/item_editor' %>
    <%= javascript_include_tag 'vcard/view/dimensions_editor' %>
    <%= javascript_include_tag 'vcard/view/item' %>
    <%= javascript_include_tag 'vcard/view/cell' %>
    <%= javascript_include_tag 'vcard/view/context_menu' %>
    <%= javascript_include_tag 'vcard/view/link_painter' %>
    <%= javascript_include_tag 'vcard/view/view' %>

    <%= javascript_include_tag 'vcard/vcard' %>


    <% if Rails.env.development? %>
      <script type="text/javascript">

        YAHOO.util.Event.throwErrors = true;

        YAHOO.util.Event.on(window, "load", loggerInit);

        function loggerInit() {
          YAHOO.widget.Logger.enableBrowserConsole();
        }

      </script>

    <% end  %>



  </head>

  <body class="yui-skin-sam">
    <div class="main">

      <div class="header">
        <div class="block_header">

          <div class="logo">
            <%= link_to image_tag('logo.gif', :border => 0, :alt => 'logo')%>
          </div>
          <div class="menu_resize">
            <div class="menu">
              <ul>
                <% if current_user.account_type == 'operator' %>
                  <li>
                    <%= link_to "<span>#{t(:create_new_grid, :scope => 'top.links')}</span>", 
                      {:controller => 'grids', :action => 'new'},
                  {:class => params[:controller] == 'grids' && params[:action] == 'new' ? 'active' : ''} %>
                  </li>
                  <li>
                      <%= link_to "<span>#{t(:users, :scope => 'top.links')}</span>",
                        {:controller => 'user'},
                        {:class => params[:controller] == 'user' && params[:action] == 'index' ? 'active' : ''} %>
                    </li>
                <% end %>
                <li>
                  <%= link_to "<span>#{t(:grids_list, :scope => 'top.links')}</span>",
                              {:controller => 'grids', :action => 'index'},
                              {:class => params[:controller] == 'grids' && params[:action] == 'index' ? 'active' : ''} %>
                </li>
                <li>
                  <%= link_to "<span>#{t(:logout, :scope => 'top.links')}</span>",
                    {:controller => 'login', :action => 'logout'} %>
                </li>
              </ul>
            </div>

            <div class="clr"></div>
          </div>
          <div class="clr"></div>
        </div>
        <div class="clr"></div>
      </div>

      <div class="body">
        <div class="FBG">
          <h2 class="rec">
            <span>
              <%= t 'logged_in_as', :scope => 'top.text', :user => current_user.login %><br>
            </span>
          </h2>

        </div>
        <div class="clr"></div>

        <%= yield %>

        <div class="clr"></div>
      </div>

    </div>
  </body>


</html>